<?php
$data = file_get_contents("./jiekou.json");
$result = preg_match_all('/{"标题":"(.*?)","小标题":"(.*?)","地址":"(.*?)","密钥":"(.*?)","状态":"(.*?)"}/',$data,$v);
//$yanse = file_get_contents("http://".$_SERVER['HTTP_HOST']."/api/yanse.php");
$second = $_REQUEST["msg"];
$z=strlen($second);
for( $i = 0 ; $i < $result && $i < $result ; $i ++ ){
$first=$v[1][$i];
$s=similar_text($first, $second);//如果此数与msg字数相同则返回。
if($z==$s){
$name=$v[1][$i];//名称
$dz=$v[2][$i];//接口介绍
$js=$v[3][$i];//接口地址
$tongji=$v[4][$i];//单个接口统计密钥
$Status=$v[5][$i];//状态
if(file_exists("./api/tongji/jiekou/".$tongji.".dat"))
{
$number=file_get_contents("./api/tongji/jiekou/".$tongji.".dat");
}else{
$number= "0";
}
if($Status == "正常"){
echo '<a href="'.$js.'" class="package list-group-item" target="_blank" alt="'.$name.'"><div class="row"><div class="col-md-3"><h4 class="package-name">'.$name.'</h4></div><div class="col-md-9 hidden-xs"><p class="package-description">'.$dz.'</p></div><div class="package-extra-info col-md-9 col-md-offset-3 col-xs-12"><span><i class="fa fa-star"></i> '.$number.'</span></div></div></a>';
}else if($Status == "维护"){
echo '<a href="'.$js.'" class="package list-group-item" target="_blank" alt="'.$name.'"><div class="row"><div class="col-md-3"><h4 class="package-name">'.$name.'</h4></div><div class="col-md-9 hidden-xs"><p class="package-description">'.$dz.'</p></div><div class="package-extra-info col-md-9 col-md-offset-3 col-xs-12"><span><i class="fa fa-star"></i> '.$number.'</span></div></div></a>';
}else if($Status == "停更"){
echo '<a href="'.$js.'" class="package list-group-item" target="_blank" alt="'.$name.'"><div class="row"><div class="col-md-3"><h4 class="package-name">'.$name.'</h4></div><div class="col-md-9 hidden-xs"><p class="package-description">'.$dz.'</p></div><div class="package-extra-info col-md-9 col-md-offset-3 col-xs-12"><span><i class="fa fa-star"></i> '.$number.'</span></div></div></a>';
}else if($Status == "付费"){
echo '<a href="'.$js.'" class="package list-group-item" target="_blank" alt="'.$name.'"><div class="row"><div class="col-md-3"><h4 class="package-name">'.$name.'</h4></div><div class="col-md-9 hidden-xs"><p class="package-description">'.$dz.'</p></div><div class="package-extra-info col-md-9 col-md-offset-3 col-xs-12"><span><i class="fa fa-star"></i> '.$number.'</span></div></div></a>';
}else if($Status == "页面『正常』"){
echo '<a href="'.$js.'" class="package list-group-item" target="_blank" alt="'.$name.'"><div class="row"><div class="col-md-3"><h4 class="package-name">'.$name.'</h4></div><div class="col-md-9 hidden-xs"><p class="package-description">'.$dz.'</p></div><div class="package-extra-info col-md-9 col-md-offset-3 col-xs-12"><span><i class="fa fa-star"></i> 正常</span></div></div></a>';
}else if($Status == "页面『维护』"){
echo '<a href="'.$js.'" class="package list-group-item" target="_blank" alt="'.$name.'"><div class="row"><div class="col-md-3"><h4 class="package-name">'.$name.'</h4></div><div class="col-md-9 hidden-xs"><p class="package-description">'.$dz.'</p></div><div class="package-extra-info col-md-9 col-md-offset-3 col-xs-12"><span><i class="fa fa-star"></i> 维护</span></div></div></a>';
}else if($Status == "页面『付费』"){
echo '<a href="'.$js.'" class="package list-group-item" target="_blank" alt="'.$name.'"><div class="row"><div class="col-md-3"><h4 class="package-name">'.$name.'</h4></div><div class="col-md-9 hidden-xs"><p class="package-description">'.$dz.'</p></div><div class="package-extra-info col-md-9 col-md-offset-3 col-xs-12"><span><i class="fa fa-star"></i> 付费</span></div></div></a>';
}}}
?>